﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Xunit;

namespace dogd.Tests
{    
	public enum NotAttributed
    {
        None,
        First,
        Second,
        Third
    }

    public enum IsAttributed
    {
        [Description ("First Alternative")]
        None,
        [Description("Second Alternative")]
        First,
        [Description("Third Alternative")]
        Second,
        [Description("Fourth Alternative")]
        Third
    }


	public class EnumExtensionsFacts
	{
		public class TheToDescriptionMethod
		{
			[Fact]
			public void ReturnsTextifiedEnumValueIfDescriptionOmitted()
			{
				var na = NotAttributed.First;

				Assert.Equal("First", na.ToDescription());
			}

			[Fact]
			public void ReturnsDescriptionIfValueIsAttributed()
			{
				var ia = IsAttributed.First;

				Assert.Equal("Second Alternative", ia.ToDescription());
			}
		}
    }
}
